package cn.hznc.controller.screen;

import cn.hznc.controller.service.screen.ScreenService;
import cn.hznc.domain.entity.screen.CncToolOutputEntity;
import cn.hznc.domain.request.schedule.ToolDemandPredictionReq;
import cn.hznc.domain.request.screen.*;
import cn.hznc.domain.response.ResponseBody;
import cn.hznc.exception.ToolScheduleException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;


/**
 * @Author：Administrator
 * @Date：2024/3/15 11:53
 */
@RestController
@CrossOrigin(origins = "*", maxAge = 3600)
@RequestMapping("/screen")
@Slf4j
public class ScreenController{

    @Resource
    private ScreenService screenService;

    /**
     * 数控刀具产量编辑
     *
     * @return
     */
    @RequestMapping(value = "/editCncToolOutput", method = RequestMethod.POST)
    public ResponseBody editCncToolOutput(@RequestBody EditCncToolOutputReq editCncToolOutputReq) {
        return ResponseBody.success(screenService.editCncToolOutput(editCncToolOutputReq));
    }


    /**
     * 数控刀具产量编辑
     *
     * @return
     */
    @RequestMapping(value = "/qryCncToolOutput", method = RequestMethod.GET)
    public ResponseBody qryCncToolOutput() {
        return ResponseBody.success(screenService.qryCncToolOutput());
    }

    /**
     * 成本数据编辑
     *
     * @return
     */
    @RequestMapping(value = "/editCostData", method = RequestMethod.POST)
    public ResponseBody editCostData(@RequestBody EditDataReq editDataReq) {
        return ResponseBody.success(screenService.editCostData(editDataReq));
    }

    /**
     * 成本数据查询
     *
     * @return
     */
    @RequestMapping(value = "/qryCostData", method = RequestMethod.GET)
    public ResponseBody qryCostData() {
        return ResponseBody.success(screenService.qryCostData());
    }

    /**
     * 刀具种类交付率编辑
     *
     * @return
     */
    @RequestMapping(value = "/editToolDeliverRate", method = RequestMethod.POST)
    public ResponseBody editToolDeliverRate(@RequestBody EditToolDeliverRateReq editToolDeliverRateReq) {
        return ResponseBody.success(screenService.editToolDeliverRate(editToolDeliverRateReq));
    }

    /**
     * 刀具种类交付率查询
     *
     * @return
     */
    @RequestMapping(value = "/qryToolDeliverRate", method = RequestMethod.GET)
    public ResponseBody qryToolDeliverRate() {
        return ResponseBody.success(screenService.qryToolDeliverRate());
    }

    /**
     * 刀具合格率编辑
     *
     * @return
     */
    @RequestMapping(value = "/editToolQualifiedRate", method = RequestMethod.POST)
    public ResponseBody editToolQualifiedRate(@RequestBody EditToolQualifiedRateReq editToolQualifiedRateReq) {
        return ResponseBody.success(screenService.editToolQualifiedRate(editToolQualifiedRateReq));
    }

    /**
     * 刀具合格率编辑
     *
     * @return
     */
    @RequestMapping(value = "/qryToolQualifiedRate", method = RequestMethod.GET)
    public ResponseBody qryToolQualifiedRate() {
        return ResponseBody.success(screenService.qryToolQualifiedRate());
    }

    /**
     * 质量合格率合格率编辑
     *
     * @return
     */
    @RequestMapping(value = "/editQualityQualifiedRate", method = RequestMethod.POST)
    public ResponseBody editQualityQualifiedRate(@RequestBody EditQualityQualifiedRateReq editQualityQualifiedRateReq) {
        return ResponseBody.success(screenService.editQualityQualifiedRate(editQualityQualifiedRateReq));
    }

    /**
     * 质量合格率合格率编辑
     *
     * @return
     */
    @RequestMapping(value = "/qryQualityQualifiedRate", method = RequestMethod.GET)
    public ResponseBody qryQualityQualifiedRate() {
        return ResponseBody.success(screenService.qryQualityQualifiedRate());
    }

    /**
     * 生产数据编辑
     *
     * @return
     */
    @RequestMapping(value = "/editProductionData", method = RequestMethod.POST)
    public ResponseBody editProductionData(@RequestBody EditProductionDataReq editProductionDataReq) {
        return ResponseBody.success(screenService.editProductionData(editProductionDataReq));
    }

    /**
     * 生产数据查询
     *
     * @return
     */
    @RequestMapping(value = "/qryProductionData", method = RequestMethod.GET)
    public ResponseBody qryProductionData() {
        return ResponseBody.success(screenService.qryProductionData());
    }

    /**
     * 年度数据编辑
     *
     * @return
     */
    @RequestMapping(value = "/editAnnualData", method = RequestMethod.POST)
    public ResponseBody editAnnualData(@RequestBody EditAnnualDataReq editAnnualDataReq) {
        return ResponseBody.success(screenService.editAnnualData(editAnnualDataReq));
    }

    /**
     * 年度数据查询
     *
     * @return
     */
    @RequestMapping(value = "/qryAnnualData", method = RequestMethod.GET)
    public ResponseBody qryAnnualData() {
        return ResponseBody.success(screenService.qryAnnualData());
    }

}
